
// 页面跳转滚动到顶部
import { useLocation } from 'react-router-dom';
import { useEffect, FC } from 'react';
const ScrollToTop: FC = () => {
    const Location = useLocation();

    useEffect(() => {
        window.scrollTo(0, 0);
    }, [Location]);

    return null; //该组件不需要渲染任何内容};  
}
export default ScrollToTop;  